diff --git a/sympy/sets/handlers/intersection.py b/sympy/sets/handlers/intersection.py
index 8710b6db17..3105fc4acf 100644
--- a/sympy/sets/handlers/intersection.py
+++ b/sympy/sets/handlers/intersection.py
@@ -252,9 +252,13 @@ def intersection_sets(self, other): # noqa:F811
                 return
             else:
                 soln, solm = solns[0]
-                (t,) = soln.free_symbols
-                expr = fn.subs(n, soln.subs(t, n))
-                return imageset(Lambda(n, expr), S.Integers)
+                if isinstance(soln, int):
+                    # Handle the case when soln is an integer, which means it has no free symbols.
+                    return EmptySet
+                else:
+                    (t,) = soln.free_symbols
+                    expr = fn.subs(n, soln.subs(t, n))
+                    return imageset(Lambda(n, expr), S.Integers)
 
     if other == S.Reals:
         from sympy.solvers.solveset import solveset_real
